<me:UIIGABEW x:Class="WPFExcelReport.TCGB14"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                     xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    x:Name="TV"
                    Loaded="Window_Loaded"
                     FTAUTOSUM="True"
                    SKEY1="GABMANDANT" 
                     KEY1="GABKG"
                    TKEY1="总数量"
                    TCOUNT1="箱数"
     >
    <me:UIIGABEW.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:M2YD x:Key="m2yd"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIIGABEW.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition> 
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Visibility="{Binding IsCanChg,ElementName=TV,Converter={StaticResource bv}}">
            <WrapPanel>
            <Button Margin="20,0,0,0" Content="{Binding Source={Localization:Translate Word=调整数据}}" Click="WBWAdjustCommand"  ></Button>
                <TextBlock Margin="20,0,0,0" Text="{Binding Source={Localization:Translate Word=日期}}"></TextBlock>
                <ex:NumericBox Margin="20,0,0,0"  Text="{Binding WBEWBUCHDAT}" 
                           IsReadOnly="{Binding IsNew,Converter={StaticResource not}}"
                           Width="100"/>
            <WrapPanel Visibility="{Binding IsNew,ElementName=TV,Converter={StaticResource bv}}">
                    <TextBlock Margin="20,0,0,0"  Foreground="Red" Text="{Binding Source={Localization:Translate Word=若有关联记录，都需要手工调整}}"/>
                <Button  Click="WBWAdjustCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
            </WrapPanel>
            <WrapPanel Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                <Button Margin="20,0,0,0"  Click="DailyAdjustCommand" Height="20"  Width="Auto" Content="{Binding Source={Localization:Translate Word=涉及日期}}"/>
                <TextBlock Margin="20,0,0,0"  Text="{Binding INFO,ElementName=TV}"/> 
            </WrapPanel>
        </StackPanel>
        <DataGrid  Grid.Row="1"
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0"                    >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=GABPARTIE}" Header="{Binding Source={Localization:Translate Word=批号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GABKG,Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:Translate Word=数量}}"  Width="Auto" /> 
                <DataGridTextColumn Binding="{Binding Path=GABAUFKRS}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GABAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=单号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GABAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GABBUCHDAT}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GABBUCHZEIT}" Header="{Binding Source={Localization:Translate Word=时间}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GABBUCHBEN}" Header="{Binding Source={Localization:Translate Word=操作人}}"  Width="Auto" /> 
                <DataGridTextColumn Binding="{Binding Path=GABBELEG}" Header="{Binding Source={Localization:Translate Word=ID}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=GABLBEH,Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=箱号}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  > 
    </Grid>
</me:UIIGABEW>
